package batch.common.report;

import java.io.*;
import batch.common.mail.*;

public class ReportError {
    public static void byEmail(String sSubject, String sBody) {
        BufferedReader br = null;

        try {
            br = new BufferedReader(new FileReader("/home01/sfc/batch/common/email_addr.txt"));
            String sLine = null;

            while ((sLine = br.readLine()) != null) {
                MailSender.sendMail("newsletter@samsungmobile.com", sLine.trim(), sSubject, sBody);
            }
        }
        catch (Exception e) {
            e.printStackTrace();
        }
        finally {
            if (br!=null) try { br.close(); } catch (Exception e) {}
        }
    }
}
